<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>员工</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" th:href="@{lib/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
    <link rel="stylesheet" th:href="@{css/public.css}" media="all">
    <style>
        .layui-card {
            border: 1px solid #f2f2f2;
            border-radius: 5px;
        }

        .icon {
            margin-right: 10px;
            color: #1aa094;
        }

        .icon-cray {
            color: #ffb800 !important;
        }

        .icon-blue {
            color: #1e9fff !important;
        }

        .icon-tip {
            color: #ff5722 !important;
        }

        .layuimini-qiuck-module {
            text-align: center;
            margin-top: 10px
        }

        .layuimini-qiuck-module a i {
            display: inline-block;
            width: 100%;
            height: 60px;
            line-height: 60px;
            text-align: center;
            border-radius: 2px;
            font-size: 30px;
            background-color: #F8F8F8;
            color: #333;
            transition: all .3s;
            -webkit-transition: all .3s;
        }

        .layuimini-qiuck-module a cite {
            position: relative;
            top: 2px;
            display: block;
            color: #666;
            text-overflow: ellipsis;
            overflow: hidden;
            white-space: nowrap;
            font-size: 14px;
        }

        .welcome-module {
            width: 100%;
            height: 210px;
        }

        .panel {
            background-color: #fff;
            border: 1px solid transparent;
            border-radius: 3px;
            -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
            box-shadow: 0 1px 1px rgba(0, 0, 0, .05)
        }

        .panel-body {
            padding: 10px
        }

        .panel-title {
            margin-top: 0;
            margin-bottom: 0;
            font-size: 12px;
            color: inherit
        }

        .label {
            display: inline;
            padding: .2em .6em .3em;
            font-size: 75%;
            font-weight: 700;
            line-height: 1;
            color: #fff;
            text-align: center;
            white-space: nowrap;
            vertical-align: baseline;
            border-radius: .25em;
            margin-top: .3em;
        }

        .layui-red {
            color: red
        }

        .main_btn > p {
            height: 40px;
        }

        .layui-bg-number {
            background-color: #F8F8F8;
        }

        .layuimini-notice:hover {
            background: #f6f6f6;
        }

        .layuimini-notice {
            padding: 7px 16px;
            clear: both;
            font-size: 12px !important;
            cursor: pointer;
            position: relative;
            transition: background 0.2s ease-in-out;
        }

        .layuimini-notice-title, .layuimini-notice-label {
            padding-right: 70px !important;
            text-overflow: ellipsis !important;
            overflow: hidden !important;
            white-space: nowrap !important;
        }

        .layuimini-notice-title {
            line-height: 28px;
            font-size: 14px;
        }

        .layuimini-notice-extra {
            position: absolute;
            top: 50%;
            margin-top: -8px;
            right: 16px;
            display: inline-block;
            height: 16px;
            color: #999;
        }
    </style>
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md5">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md5">
                        <div class="layui-card" >
                            <div class="layui-card-header"><i class="fa fa-warning icon" style="text-align: center"></i>打卡上班</div>
                            <div class="layui-card-body"style="text-align: center">
                                <div class="welcome-module" style="text-align: center">
                                    <a class="layui-btn layui-btn-fluid"
                                       id="empattendanceadd" name="empattendanceadd" style="text-align: center">打卡上班</a>
                                </div>
                            </div>
                            <div class="layui-card-body"style="text-align: center">
                                <div class="welcome-module" style="text-align: center">
                                    <a class="layui-btn layui-btn-fluid" style="text-align: center"
                                       id="empattendanceupdate" name="empattendanceupdate">打卡下班</a>
                                </div>
                            </div>

                        </div>

                    </div>
                </div>
            </div>


        </div>
    </div>
</div>
</div>
<script th:src="@{lib/layui/layui.js}" charset="utf-8"></script>
<script th:src="@{js/lay-config.js?v=1.0.4}" charset="utf-8"></script>
<script>
    layui.use(['layer', 'miniTab', 'echarts'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            miniTab = layui.miniTab,
            echarts = layui.echarts;

        miniTab.listen();

        $('#empattendanceadd').on("click", function () {
            var url = "/attendance/empadd";
            $.post(url, function (res) {
                console.log(res);
                if (res.code === 0) {
                    layer.msg(res.message, {
                        icon: 1,
                        time: 2000
                    });
                } else {
                    layer.msg('今日已经打过卡了,请不要重复打卡', {
                        icon: 2,
                        time: 2000, //2秒关闭（如果不配置，默认是3秒）
                        anim: 6
                    }, function () {
                    });
                }
            })
        });

        $('#empattendanceupdate').on("click", function () {
            var url = "/attendance/empupdate";
            $.post(url, function (res) {
                console.log(res);
                if (res.code === 0) {
                    layer.msg(res.message, {
                        icon: 1,
                        time: 2000
                    });
                } else {
                    layer.msg(res.message, {
                        icon: 2,
                        time: 2000, //2秒关闭（如果不配置，默认是3秒）
                        anim: 6
                    }, function () {
                    });
                }
            })
        });



    });
</script>
</body>
</html>
